-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate ref.setNativeProps in favor of ReactNative.setNativeProps #14912
Deprecate ref.setNativeProps in favor of ReactNative.setNativeProps #14912
Conversation
How long will it take to convert all of RN Core to use the new API? I feel like adding a warning for everyone in the community and silencing them internally isn't great :( |
Details of bundled changes.Comparing: f978d5f...f863070 react-native-renderer
scheduler
Generated by 🚫 dangerJS |
Well, just loading the internal Playground view with this change popped up 115 warnings. Sounds like we should migrate the core before landing this. |
I'm thinking that I will probably want to land this and add the warning to the yellowbox ignores for core RN so that nobody sees the error but it will be easy for us to comment out the ignore line and fix them. Right now in order to see these warnings we have to do a sync first which is painful. |
We do have separate builds from FB and open source. If you want, you could add this behind a feature flag that we only enable for FB. Add it here: https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js Enable here: https://github.com/facebook/react/blob/master/scripts/rollup/shims/react-native-fb/ReactFeatureFlags.js |
@@ -27,6 +27,7 @@ export const debugRenderPhaseSideEffectsForStrictMode = true; | |||
export const disableInputAttributeSyncing = false; | |||
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__; | |||
export const warnAboutDeprecatedLifecycles = true; | |||
export const warnAboutDeprecatedSetNativeProps = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. Is this the canonical one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by canonical? It seems like to get Flow to pass these consts have to be defined in every file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nvm. I understand. I need to re-export the one from FeatureFlags. I'm testing this change more closely to ensure I can actually flip this on in FBSource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should actually remove it from the dynamic one if possible. Whenever possible we should always use static flags and drive to remove the dynamic ones.
Related to: react-native-community/discussions-and-proposals#72
We want people to call the new top level API for setNativeProps that was added in #14907. This PR adds deprecation warnings for the current methods.
I need to think about how I want to handle the migration of core and internal and could use some insight. I could: